<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@include file="/common/taglibs.jsp" %>
<!DOCTYPE>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
		<title>WebUpload</title>
		<link href="/resources/src/css/main.css" rel="stylesheet">
   		<link href="/resources/src/css/responsive.css" rel="stylesheet">
		<link href="/resources/src/css/user-manage.css" rel="stylesheet">
		<link href="/resources/src/css/projects-manage.css" rel="stylesheet">
        <script src="http://lib.sinaapp.com/js/jquery/1.9.1/jquery-1.9.1.min.js"></script>
	    <script src="https://cdn.bootcss.com/jquery.nicescroll/3.7.0/jquery.nicescroll.js"></script>
	    <!--引入CSS-->
		<link rel="stylesheet" type="text/css" href="/resources/src/webuploader/webuploader.css">
		<!--引入JS-->
		<script type="text/javascript" src="/resources/src/webuploader/webuploader.js"></script>
	</head>
	<body class="sticky-header left-side-collapsed">
		<div id="uploader" class="wu-example">
		    <!--用来存放文件信息-->
		    <div id="thelist" class="uploader-list"></div>
		    <div class="btns">
		        <div id="picker"></div>
		        <button id="ctlBtn" class="btn btn-default">开始上传</button>
		    </div>
		</div>
	
		<script type="text/javascript">
			var uploader = WebUploader.create({
			    // swf文件路径
			    swf: '/resources/src/webuploader/Uploader.swf',
	
			    // 文件接收服务端。
			    server: 'http://webuploader.duapp.com/server/fileupload.php',
	
			    // 选择文件的按钮。可选。
			    // 内部根据当前运行是创建，可能是input元素，也可能是flash.
			    //pick: '#picker',
	            pick: {
	                id: '#picker',
	                innerHTML: '点击选择图片',
	                multiple: true
	            },
	
	            accept:{
	            	title:'上传图片',
	            	extensions: 'gif,jpg,jpeg,bmp,png',
	            	mimeTypes : 'image/*'
	            },
	            
			    //不压缩image, 默认如果是jpeg，文件上传前会压缩一把再上传！
			    resize: false
			});
			
			// 当有文件被添加进队列的时候
			uploader.on( 'fileQueued', function( file ) {
				alert(file.name);
			   /*  $list.append( '<div id="' + file.id + '" class="item">' +
			        '<h4 class="info">' + file.name + '</h4>' +
			        '<p class="state">等待上传...</p>' +
			    '</div>' ); */
			});
			
			uploader.on( 'uploadError', function( file ) {
				alert('失败');
			   // $( '#'+file.id ).find('p.state').text('上传出错');
			});
		</script>
	</body>
</html>